<template>
  <div id="count-info" class="count-info">
    <div class="count-item">
      <img src="../../assets/mengli/downloadip.png" class="img" alt="">
      <div class="count-item-right">
        <span class="count-value">
          <el-tooltip class="item" placement="top" effect="dark">
            <div slot="content" style="max-width: 200px;">{{ count.downloadNum | detailDataFilter }}</div>
            <span class="inner-count-value">{{ count.downloadNum | bigDataFilter }}</span>
          </el-tooltip>
        </span>
        <div class="count-key">总下载量</div>
      </div>
    </div>
    <div class="count-item">
      <img src="../../assets/mengli/totalSend.png" class="img" alt="">
      <div class="count-item-right">
        <span class="count-value">
          <el-tooltip class="item" placement="top" effect="dark">
            <div slot="content" style="max-width: 200px;">{{ count.sendNum | detailDataFilter }}</div>
            <span class="inner-count-value">{{ count.sendNum | bigDataFilter }}</span>
          </el-tooltip>
        </span>
        <div class="count-key">总发送量</div>
      </div>
    </div>
    <div class="count-item">
      <img src="../../assets/mengli/totallikeNum.png" class="img" alt="">
      <div class="count-item-right">
        <span class="count-value">
          <el-tooltip class="item" placement="top" effect="dark">
            <div slot="content" style="max-width: 200px;">{{ count.rewardsNum | detailDataFilter }}</div>
            <span class="inner-count-value">{{ count.rewardsNum | bigDataFilter }}</span>
          </el-tooltip>
        </span>
        <div class="count-key">总赞赏次数</div>
      </div>
    </div>
    <div class="count-item">
      <img src="../../assets/mengli/totallikePrice.png" class="img" alt="">
      <div class="count-item-right">
        <span class="count-value">
          <el-tooltip class="item" placement="top" effect="dark">
            <div slot="content" style="max-width: 200px;">{{ count.rewardsAmount | detailDataFilter }}</div>
            <span class="inner-count-value">{{ count.rewardsAmount | bigDataFilter }}</span>
          </el-tooltip>
        </span>
        <div class="count-key">总赞赏金额</div>
      </div>
    </div>
    <div class="count-item">
      <img src="../../assets/mengli/biaoqingnum.png" class="img" alt="">
      <div class="count-item-right">
        <span class="count-value">
          <el-tooltip class="item" placement="top" effect="dark">
            <div slot="content" style="max-width: 200px;">{{ count.stickersNum | detailDataFilter }}</div>
            <span class="inner-count-value">{{ count.stickersNum | bigDataFilter }}</span>
          </el-tooltip>
        </span>
        <div class="count-key">表情包套数</div>
      </div>
    </div>
    <div v-for="i of itemNum" :key="i" class="count-item"/>
  </div>
</template>
<script>
import { moneyFilter, bigDataFilter } from '@/filters/number';
export default {
  filters: {
    bigDataFilter,
    detailDataFilter(num) {
      if (num) {
        return moneyFilter(num);
      } else if (num === 0) {
        return 0;
      } else {
        return '--';
      }
    }
  },
  props: {
    count: {
      type: Object,
      default: () => {
        return {};
      }
    }
  },
  data() {
    return {
      minWidth: 'auto',
      itemNum: 0
    };
  },
  mounted() {
    // this.$nextTick(() => {
    //   window.onresize = () => {
    //     this.getWidth();
    //   };
    //   this.getWidth();
    // });
  },
  methods: {
    // getWidth() {
    //   const countInfo = document.getElementById('count-info');
    //   if (countInfo) {
    //     const offsetWidth = countInfo.offsetWidth;
    //   }
    // }
  }
};
</script>
<style lang="scss" scoped>
.count-info {
  display: flex;
  -webkit-box-shadow: 2px 4px 13px 0px #dde1ea;
  padding: 50px 10px 25px 20px;
  box-shadow: 2px 4px 13px 0px #dde1ea;
  background-color: #fff;
  border-radius:12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  .count-item {
    flex: 1;
    width: 20%;
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    border-right: 1px solid #F7F7F7;
    padding-left: 20px;
    padding-right: 20px;
    &:last-child {
      border-right: none;
    }
    .img {
      width: 48px;
      height: 48px;
      margin-right: 15px;
    }
    .count-item-right {
      width: calc(100% - 50px);
      .count-key {
        font-size:15px;
        font-family:AlibabaPuHuiTi-Regular,AlibabaPuHuiTi;
        font-weight:400;
        color:rgba(169,175,182,1);
        line-height:16px;
        margin-top: 18px;
        white-space: nowrap;
      }
      .count-value {
        font-size:22px;
        font-family:AlibabaPuHuiTi-Medium,AlibabaPuHuiTi;
        font-weight:500;
        color:rgba(51,51,51,1);
        line-height:24px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        display: inline-block;
        display: flex;
        width: 100%;
        .foot-text {
          font-size:14px;
        }
      }
      .inner-count-value {
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
        display: inline-block;
      }
      .blod{
        font-weight: 550;
      }
    }
  }
}
</style>
